package org.example.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.example.JoinGroupResponsePacket;
import org.example.QuitGroupResponsePacket;

public class QuitGroupResponseHandler extends SimpleChannelInboundHandler<QuitGroupResponsePacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, QuitGroupResponsePacket quitGroupResponsePacket) {
        if (quitGroupResponsePacket.isSuccess()){
            System.out.println("用户" +  quitGroupResponsePacket.getUserId()
                    + "退出群[" + quitGroupResponsePacket.getGroupId() + "]成功.");
        }else {
            System.out.println("用户" +  quitGroupResponsePacket.getUserId()
                    + "退出群[" + quitGroupResponsePacket.getGroupId() + "]失败.");
        }
    }
}
